import {createStore} from 'vuex'

const store = createStore({
    state() {
        return {
            current: 0,
            userInfo: {},
            token: ''
        }
    },
    mutations: {
        setCurrent(state, index) {
            state.current = index
        },
        setUserInfo(state, data) {
            state.userInfo = data
        },
        setToken(state, str) {
            state.token = str
        }
    },
})
export default store;